<template>
  <div>
    <TopWrap></TopWrap>
    <div class="collect_box clearfix">
      <div class="collect_head">
        <div class="collect_header">
          <div class="my_collect">我收藏的</div>
          <div class="select_all"><input type="checkbox" />全选</div>
          <div class="prohibit_purchase">立即结算</div>
        </div>
      </div>
      <div class="collect_body">
        <div class="book_main_list">
          <!-- booklist是展示的每一个商品信息 -->
          <div class="book_list" v-for="item in collectGoods" :key="item.id">
            <div class="book_list_top">
              <div>
                <input type="checkbox" class="select" />
              </div>
              <a href="book_detail.html" target="_blank"
                ><span
                  ><img :src="item.img" alt="暂无具体信息" class="goods"
                /></span>
                <h4>
                  {{item.title}}
                </h4></a
              >
            </div>
            <div class="book_list_bottom">
              <div class="price">
                <div class="price_unit">¥</div>
                <div class="price_value">{{item.price}}</div>
                <div class="business">出自于{{item.author}}</div>
                <img src="@/assets/images/love.png" class="love" title="收藏" />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'CollectBooks',
  computed: {
    ...mapState(['collectGoods'])
  }
}
</script>

<style scoped>
/* 清除浮动 */
.clearfix:after {
  content: "";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}
.clearfix {
  /*IE6、7 专有 */
  *zoom: 1;
}
.collect_box {
  position: relative;
  width: 1100px;
  margin: 45px auto;
  background-color: white;
  border-radius: 20px;
}
.collect_header {
  position: relative;
  margin: 0 auto;
  height: 95px;
  /* text-align: center; */
  line-height: 60px;
  font-size: 18px;
  border-bottom: 2px solid #e5e5e5;
}
.my_collect {
  position: absolute;
  width: 120px;
  height: 60px;
  top: 0;
  left: 5px;
  padding: 0 5px;
  font-size: 18px;
  text-align: center;
  line-height: 60px;
  color: #6d757a;
  /* background-color: #f2f1ea; */
  border-radius: 5px 5px 0 0;
}
.select_all {
  position: absolute;
  top: 60px;
  left: 5px;
  width: 120px;
  height: 35px;
  font-size: 18px;
  line-height: 35px;
  text-align: center;
  color: #6d757a;
  border-bottom: 2px solid #6d757a;
  /* background-color: #f2f1ea */
}
.select_all input {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-bottom: 5px;
}

.collect_header .prohibit_purchase {
  position: absolute;
  width: 120px;
  height: 60px;
  top: 20px;
  right: 28px;
  padding: 0 5px;
  font-size: 18px;
  text-align: center;
  line-height: 60px;
  /* color: #E5511D; */
  color: #6d757a;
  background: #f2f1ea;
  /* border-color: #F0CAB6;
    background: #FFE4D0; */
  /* background-color: #f2f1ea; */
  border-radius: 30px;
  cursor: not-allowed;
}
.collect_header .purchase {
  position: absolute;
  width: 120px;
  height: 60px;
  top: 20px;
  right: 5px;
  padding: 0 5px;
  font-size: 18px;
  text-align: center;
  line-height: 60px;
  color: #e5511d;
  border-color: #f0cab6;
  background-color: #ffe4d0;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.5s;
}

.collect_header .purchase:hover {
  transform: translateY(-8%);
  box-shadow: 2px 4px 5px rgb(0 0 0 / 10%);
}
.collect_body {
  display: block;
  /* display: none; */
  padding-top: 25px;
  background-color: #fff;
}

.book_main_list {
  /* position: relative; */
  margin: 0 auto;
}

.book_list {
  position: relative;
  width: 245px;
  height: 340px;
  background: #fff;
  margin-left: 25px;
  margin-bottom: 24px;
  float: left;
  border: 1px solid rgb(0 0 0 / 20%);
  border-radius: 5px;
  box-shadow: 2px 4px 5px rgb(0 0 0 / 10%);
  cursor: pointer;
  /* overflow: hidden; */
}

.book_list .select {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 25px;
  height: 25px;
  border-radius: 5px;
}

.book_list:hover .select {
  display: block;
  z-index: 1;
}
.book_list .act {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 25px;
  height: 25px;
  border-radius: 5px;
  z-index: 1;
}
.book_list a {
  color: black;
  text-decoration: none;
}

.book_list_top {
  width: 245px;
  height: 275px;
}

.book_list img {
  width: 100%;
  height: 220px;
  transition: all 0.2s;
}

.book_list:hover {
  /* box-shadow: 2px 4px 8px rgb(0 0 0 / 10%); */
  border: 2px solid #f5f5f5;
  box-shadow: 5px 8px 8px rgb(0 0 0 / 10%);
}

/* .book_list:hover .goods {
  transform: translateY(-6px);
} */

.book_list_bottom {
  width: 245px;
  height: 65px;
}

.book_list h4 {
  height: 40px;
  width: 230px;
  color: #222;
  font: 16px/1.25 Microsoft Yahei, Hiragino Sans GB, Heiti SC,
    WenQuanYi Micro Hei, sans-serif !important;
  font-weight: 400;
  /* line-height: 20px; */
  text-align: left;
  margin: 5px auto;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.book_main_list .price {
  height: 65px;
  padding-left: 8px;
  font-weight: 400;
  text-align: center;
  line-height: 65px;
  vertical-align: middle;
}

.price .price_unit {
  font-size: 20px;
  color: #fd3f31;
  float: left;
  padding-top: 15px;
  margin: 0 5px 0 6px;
  line-height: 22px;
}

.price .price_value {
  font-size: 35px;
  line-height: 22px;
  color: #fd3f31;
  padding-top: 10px;
  float: left;
}

.price .business {
  font-size: 10px;
  color: rgb(153, 153, 153);
  float: left;
  padding-top: 18px;
  margin-left: 20px;
  line-height: 22px;
}

.price .love {
  float: left;
  width: 25px;
  height: 25px;
  margin: 10px 0 0 48px;
}

.price .love:hover {
  transform: translateY(-1px);
}
</style>
